package demo4;

public class Animal {
    public String name;
    public int age;
    public String color;

    public Animal(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }
    public void eat(){
        System.out.println(this.name+"正在吃饭...");
    }
}
class Cat extends Animal{

    public Cat(String name, int age, String color) {
        super(name, age, color);
    }

    public void miaomiao(){
        System.out.println(this.name+"正在喵喵喵...");
    }
}
class Dog extends Animal{
    public Dog(String name, int age, String color) {
        super(name, age, color);
    }

    public void bark(){
        System.out.println(this.name+"正在汪汪叫...");
    }
}
class Test{
    public static void main(String[] args) {
        Cat cat = new Cat("小白",2,"白");
    }
}


